/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM Extend Project: Open Source CFD        |
|  \\    /   O peration     | Version:  1.6-ext                               |
|   \\  /    A nd           | Web:      www.extend-project.de                 |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// dynamicFvMesh       staticFvMesh;

////////////////

// dynamicFvMesh dynamicMotionSolverFvMesh;
//
// // motionSolverLibs ("libfvMotionSolver.so");
//
// twoDMotion      yes;
//
// solver          laplaceFaceDecomposition;
//
// // linear
// // distortionEnergy
// // uniform
// // quadratic
// // file
// // deformationEnergy
// // exponential
// // patchEnhanced
//
// diffusivity     quadratic; // quadratic
//
// frozenDiffusion on;
//
// distancePatches
// (
//     consoleFluid
// );

// solver            displacementLaplacian;
//
// diffusivity       inverseDistance (consoleFluid);

/////////////

// Select the type of dynamicFvMesh, and load custom library
dynamicFvMesh           dynamicMotionSolverFvMesh;

solver                  mesquiteMotionSolver;
//solver                  laplaceFaceDecomposition;
//diffusivity             uniform 1.0;
//diffusivity             quadratic;
//distancePatches         (topWall);
//frozenDiffusion         off;

mesquiteOptions
{
    // Optimization metric
    optMetric               MeanRatio;
//     optMetric               AspectRatioGamma;
//     optMetric
//     {
// //         firstMetric   EdgeLength;
//         firstMetric MeanRatio;
// //         secondMetric MeanRatio;
//         secondMetric  AspectRatioGamma;
//     }

    // Objective function
    objFunction             LPtoP; //CompositeOFAdds;

    // Optimization algorithm
//     optAlgorithm            FeasibleNewton;
    optAlgorithm            ConjugateGradient;

    // Termination criteria sub-dictionary (takes default values if not specified)
    // Specifying an empty sub-dictionary terminates with available options
    tcInner
    {
       //relGradL2            1e-2;
       //cpuTime              0.5;
       iterationLimit       1;
    }
    // tcOuter
    // {}

    sliverThreshold        0.05;

    // For composite functions, two objectives need to be specified
    firstFunction           LPtoP;
    secondFunction          LPtoP;

    // For scaled functions, scale and objective needs to be specified
    // scaleFunction        PMeanP;
    // scale                1.5;

    // Power value for the LPtoP objective function
    pValue                  2;
    power                   2;

    // Specify a tolerance for the CG solver
    tolerance               1e-2;

    // Specify number of CG sweeps
    nSweeps                 1;

    // Specify a relaxation factor, if necessary
    //relaxationFactor        0.1;

    // Specify slip patches for the motionSolver
    slipPatches
    {
//         sideWall;
//         topWall;
//         bottomWall;
    }

    cylindricalConstraints
    {
//         // Specify options per slip patch
//         sideWall
//         {
//             axisPoint      (0.0 0.0 0.0);
//             axisVector     (0.0 0.0 1.0);
//             radius          1.0;
//         }
    }

    // Specify fixedValue patches for the motionSolver
    fixedValuePatches
    {
//         topWall
//         {
//             //type          angularOscillatingDisplacement;
//             //amplitude     -0.0125;
//             type          oscillatingDisplacement;
//             amplitude     (0 0 0.01);
//             axis          (1 0 0);
//             origin        (0 0 3);
//             angle0        0.0;
//             omega         0.15;
//             value         uniform (0 0 0);
//         }
    }

    // Specify interval for surface smoothing
    surfInterval            1;
}

// ************************************************************************* //

